<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>登陆</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="/static/layuiadmin/style/login.css" media="all">
    <style>
        .bg{
            background-image: url('/static/images/bg-admin-login.jpg');
            background-size: cover;
            z-index: -99;/*-1 可以当背景*/
            -webkit-filter: blur(30px);
            filter: blur(30px);
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
        }
    </style>
</head>
<body>
<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">
    <div class="layadmin-user-login-main">
        <div class="layadmin-user-login-box layadmin-user-login-header">
            <h2>后台管理系统</h2>
            <!-- <p>一个XXX的后台管理系统666</p> -->
        </div>

        <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                <input type="text" name="account" lay-verify="account" placeholder="用户名" autocomplete="off" class="layui-input">
            </div>

            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                <input type="password" name="password" lay-verify="password" placeholder="密码" autocomplete="off" class="layui-input">
            </div>
        
            <div class="layui-form-item">
                <button type="submit" class="layui-btn layui-btn-fluid" lay-submit="" lay-filter="submit">登陆</button>
            </div>
        </div>
    </div>
</div>

<div class="bg"></div>

<script charset="utf-8" src="/static/layui/layui.js" type="text/javascript"></script>
<script charset="utf-8" src="/static/js/jquery.min.js" type="text/javascript"></script>
<script>
    layui.use(['form'], function(){
        var form = layui.form;

        form.on('submit(submit)', function(data){
            $.post('{:url("Login/login_data")}', data.field, function(res){
                if(res.code == 0){
                    layer.msg(res.msg, {icon: 1});
                    setTimeout(() => {
                        window.location.href = "{:url('Index/index')}";
                    }, 1000);
                }else{
                    layer.msg(res.msg, {icon: 2});
                }
            })
            return false;
        });
    });
</script>
</body>
</html>